home *** CD-ROM | disk | FTP | other *** search
- on startMovie
- global sLettre1, sPoussoir1, nFacteur, Saddit, lesPositions, niveau, sOmbre, sEcran
- set sEcran to 45
- set sLettre1 to 3
- set sPoussoir1 to 39
- set sOmbre to 35
- set Saddit to 34
- if not voidp(niveau) then
- set dest to "niv" & niveau
- else
- set dest to "niv1"
- end if
- go(dest)
- end
-
- on monteLaCol qui
- global sPoussoir1, lesN, lesPositions
- set colonne to qui - sPoussoir1 + 1
- effetPoussoir(qui)
- set deb to getAt(lesN, colonne)
- set fin to getAt(lesN, colonne + 1) - 1
- if the locV of sprite deb < 121 then
- setAt(lesPositions, colonne, 0)
- repeat while the locV of sprite fin < 341
- puppetSound("Chrunt")
- repeat with fois = 1 to 11
- repeat with s = deb to fin
- set the locV of sprite s to the locV of sprite s + 4
- end repeat
- attends(1)
- updateStage()
- end repeat
- end repeat
- else
- setAt(lesPositions, colonne, getAt(lesPositions, colonne) + 1)
- puppetSound("JeGlisse")
- repeat with fois = 1 to 11
- repeat with s = deb to fin
- set the locV of sprite s to the locV of sprite s - 4
- end repeat
- attends(1)
- updateStage()
- end repeat
- end if
- if verifieSolutionFinale() then
- onLa()
- retourne(1)
- end if
- end
-
- on effetPoussoir qui
- puppetSound("vrouit")
- repeat with fois = 1 to 2
- repeat with c = 234 down to 225
- set the foreColor of sprite qui to c
- updateStage()
- attends(1)
- end repeat
- end repeat
- set the foreColor of sprite qui to 255
- updateStage()
- end
-
- on echangeMoi qui
- global Saddit, sPoussoir1, sOmbre
- if the visible of sprite sPoussoir1 then
- exit
- end if
- switche(qui, Saddit)
- set the visible of sprite sOmbre to 1
- set the loc of sprite sOmbre to the loc of sprite Saddit
- set limiteInf to qui - 1
- repeat while the locH of sprite limiteInf = the locH of sprite qui
- set limiteInf to limiteInf - 1
- end repeat
- set limiteInf to limiteInf + 1
- set leVcible to the locV of sprite limiteInf
- if limiteInf < qui then
- descendsLes(limiteInf, qui - 1)
- end if
- replaceLe(Saddit, leVcible)
- switche(Saddit, limiteInf)
- puppetSound("click")
- updateStage()
- if verifieSolution() then
- partTwo()
- end if
- end
-
- on partTwo
- global sPoussoir1
- set the visible of sprite (sPoussoir1 - 1) to 1
- repeat with s = sPoussoir1 to sPoussoir1 + 5
- set the visible of sprite s to 1
- set the foreColor of sprite s to 255
- end repeat
- puppetSound("plrou")
- updateStage()
- end
-
- on lequel num
- global sLettre1, lesN
- repeat with col = 1 to 6
- if num >= getAt(lesN, col) then
- return col
- end if
- end repeat
- return 0
- end
-
- on replaceLe qui, ou
- global sOmbre
- set the visible of sprite sOmbre to 1
- set delta to ou - the locV of sprite qui
- if delta > 0 then
- set diff to 4
- else
- set diff to -4
- end if
- repeat while abs(the locV of sprite qui - ou) > 4
- set the locV of sprite qui to the locV of sprite qui + diff
- set the loc of sprite sOmbre to the loc of sprite qui
- updateStage()
- end repeat
- set the locV of sprite qui to ou
- set the visible of sprite sOmbre to 0
- updateStage()
- end
-
- on descendsLes deb, fin
- global Saddit, sOmbre
- repeat with s = fin down to deb
- switche(s, s + 1)
- end repeat
- set diff to 4
- repeat with pos = 1 to 11
- repeat with s = deb + 1 to fin + 1
- set the locV of sprite s to the locV of sprite s + 4
- end repeat
- set the locV of sprite Saddit to the locV of sprite Saddit - 4
- set the loc of sprite sOmbre to the loc of sprite Saddit
- updateStage()
- attends(1)
- end repeat
- puppetSound("move-a-tile")
- updateStage()
- end
-
- on verifieSolutionFinale
- global lesPosFinales, lesPositions
- repeat with col = 1 to 6
- if getAt(lesPosFinales, col) <> getAt(lesPositions, col) then
- return 0
- end if
- end repeat
- return 1
- end
-
- on verifieSolution
- global sLettre1, laSolution, lesN
- repeat with s = 1 to count(laSolution)
- if getAt(laSolution, s) <> the memberNum of sprite (s + sLettre1 - 1) then
- return 0
- end if
- end repeat
- return 1
- end
-